package com.spj.entity;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author :spj
 * @Date:2022/4/7
 * @description:
 */
@Data
//@ConfigurationProperties(prefix = "config-my")
@PropertySource("classpath:config.properties")
@Component
public class ConfigTest {
    @Value("${config-my.name}")
    private String name;
    @Value("${config-my.age}")
    private int age;
}
